﻿<?php
include_once '../util/db/service/SupplierBrandDBUtil.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/admin_page.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>進退貨記錄</title>
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
#cantainer {
	width: 955px;
	margin-right: 33px;
	margin-left: 33px;
}
#header {
	width: 955px;
	margin-bottom: 10px;
	background-image: url(../../images/top_bg.png);
	height: 82px;
}
#body {
	width: 955px;
	margin-bottom: 10px;
}
#footer {
	width: 955px;
}
.style2 {color: #666666;
	font-size: 12px;
}
#contant_list {
	float: left;
	width: 180px;
	margin-right: 10px;
}
.style17 {color: #74B9E5; font-size: 14px; }
.style43 {font-size: 12px; color: #666666; font-weight: bold; }
#contant_body {
	float: right;
	width: 765px;
}
-->
</style>
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
#contant_body_header {
	height: 62px;
	width: 765px;
	margin-bottom: 10px;
	background-image: url(../images/admin_supplier_inventory_in_history_header.png);
}
#contant_body_body {
	width: 765px;
	margin-bottom: 10px;
}
.style16 {font-size: 14px}
#contant_body_1_3 {
	height: 25px;
	width: 737px;
	margin-right: 10px;
	margin-bottom: 10px;
	margin-left: 10px;
	background-image: url(../images/admin_inventory_searcho_text.png);
}
#contant_body_1_4 {width: 737px;
	margin-right: 10px;
	margin-bottom: 10px;
	margin-left: 10px;
}
-->
</style>
<!-- InstanceEndEditable -->
<script src="/shopping/shopcarda2/admin/js/jquery.js"></script>
<script>
	var select={
		url:"/shopping/shopcarda2/sys/com/control/SupplierServices.php",
		conpany:"",
		init:function(){
			$.ajax(select.url,{
				data:{
					action:"getCompanys"
				},
				dataType:"json",
				error:function(data){
					alert("error:"+data);
				},
				success:function(data){
					select.comany = data;
					for(var i=0; i<data.length;i++){
						$("#cm_id").append($("<option></option>").attr("value", data[i].cm_id).text(data[i].company));
					}
					select.change();
				},
				type:"GET"
			});
		},
		change:function(){
			//alert($("#cm_id").val());
			$.ajax(select.url,{
				data:{
					action:"getBrands",
					cm_id:$("#cm_id").val()
				},
				dataType:"json",
				error:function(data){
					alert("error:"+data);
				},
				success:function(data){
					$("#sb_id").empty();
					for(var i=0; i<data.length;i++){
						$("#sb_id").append($("<option></option>").attr("value", data[i].sb_id).text(data[i].logo_name));
					}
				}
			});
		}
	};

	$(document).ready(function (){
		select.init();
		$("#cm_id").change(select.change);
	});

	function go(){
		if($("#year_id").val()==""){
			alert("請輸入訂單年份");
			$("#year_id").focus();
			return false;
		}
		if(isNaN($("#year_id").val())){
			alert("訂單年份必須為數字");
			$("#year_id").focus();
			return false;
		}
		if($("#year_id").val().length!=4){
			alert("訂單年份必須為四位");
			$("#year_id").focus();
			return false;
		}
		if($("input[name=status]:checked").val()=="ALL"){
			$("#form1").attr("action", "admin_inventory_inhistory_all_search_list.php");
		}else{
			$("#form1").attr("action", "admin_inventory_inhistory_search_list.php");
		}
		$("#form1").submit();
	}
</script>
</head>

<body>
<table width="1024" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><div id="cantainer">
      <div id="header"></div>
      <div id="body">
        <div id="contant_list">
          <table border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td align="center"><img src="../../images/index_12.png" width="180" height="54" /></td>
            </tr>
            <tr>
              <td><table width="180" border="0" align="center" cellpadding="0" cellspacing="0" background="../../images/index_12_20.png">
                  <tr>
                    <td width="10"></td>
                    <td><?php include_once '../common/menu.php';?></td>
                    <td width="10"></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td width="180" height="28" align="center"><table width="0" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="180" height="28" align="center"><img src="../../images/index_20.png" width="180" height="28" /></td>
                  </tr>
              </table></td>
            </tr>
          </table>
        </div>
        <!-- InstanceBeginEditable name="EditRegion1" -->
        <div id="contant_body">
          <div id="contant_body_header"></div>
          <div id="contant_body_body">
            <table cellpadding="0" cellspacing="0">
              <tr>
                <td colspan="3"><img src="../../member/img/member_body_up.jpg" width="765" height="9" /></td>
              </tr>
              <tr>
                <td width="4" background="../../member/img/member_body_left.jpg">&nbsp;</td>
                <td width="757">
                  <div id="contant_body_1_4">
                  <form id="form1" name="form1" method="post">
                      <table width="737" cellspacing="0" cellpadding="5">
                        <tr>
                          <td width="68" class="style16">訂單日期</td>
                          <td width="647" class="style16">
                              <label>
                          	    <input name="year" type="text" id="year_id" size="4" maxlength="4" />
                              </label> 年
                              <label>
                              <select name="month" id="select">
                              	 <option value="1">1</option>
                              	 <option value="2">2</option>
                              	 <option value="3">3</option>
                              	 <option value="4">4</option>
                              	 <option value="5">5</option>
                              	 <option value="6">6</option>
                              	 <option value="7">7</option>
                              	 <option value="8">8</option>
                              	 <option value="9">9</option>
                              	 <option value="10">10</option>
                              	 <option value="11">11</option>
                              	 <option value="12">12</option>
                              </select>
                              </label>月
                          </td>
                        </tr>
                        <tr>
							<td align="center" bgcolor="#E2F8F6" class="style16">供應商</td>
							<td align="left" bgcolor="#E2F8F6" class="style16">
								<select name="cm_id" id="cm_id"></select>
								<label>
									<select name="sb_id" id="sb_id"></select>
								</label>
                        </td>
                        </tr>
                        <tr>
                          <td align="center" class="style16">表單類別</td>
                          <td align="left" class="style16">
							<label for="status_id_1"><input type="radio" name="status" id="status_id_1" value="A" checked /> 進貨細項 </label>　
							<label for="status_id_2"><input type="radio" name="status" id="status_id_2" value="B" /> 退貨細項 </label>　
							<label for="status_id_3"><input type="radio" name="status" id="status_id_3" value="ALL" /> 進退貨總表 </label>
                          </td>
                        </tr>
                        <tr>
                          <td colspan="2" align="center" class="style16">
                              <label>
                              <input type="button" name="search_btn" id="search_btn_id" onclick="go();" value="搜尋" />
                              </label>
                              <label></label>
                          </td>
                        </tr>
                      </table>
                  </form></div></td>
                <td width="4" background="../../member/img/member_body_right.jpg">&nbsp;</td>
              </tr>
              <tr>
                <td height="9" colspan="3"><img src="../../member/img/member_body_down.jpg" width="765" height="9" /></td>
              </tr>
            </table>
          </div>
        </div>
        <!-- InstanceEndEditable --></div>
      <?php include_once '../common/footer.php';?>
      </div></td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>